package reflect;

import java.io.FileReader;
import java.util.Properties;

public class IoPropertiesTest {
    public static void main(String[] args) throws Exception {
        // 获取一个文件的绝对路径
        String path = Thread.currentThread().getContextClassLoader()
                .getResource("classinfo2.properties").getPath();
        FileReader fileReader = new FileReader(path);
        Properties properties = new Properties();
        properties.load(fileReader);
        fileReader.close();
        // 通过key来获取value
        String className = properties.getProperty("className");
        System.out.println(className);

    }
}
